package cn.xuanxuanyuhua.crm.mapper;

import cn.xuanxuanyuhua.crm.domain.Employee;
import cn.xuanxuanyuhua.crm.query.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper {
    //保存员工
    void insert(Employee record);

    //更新员工
    void updateByPrimaryKey(Employee record);

    //删除员工
    void deleteByPrimaryKey(Long id);

    //查询员工信息
    Employee selectByPrimaryKey(Long id);

    //带分页
    List<Employee> queryForList(QueryObject qo);

    //查询所有员工
    List<Employee> selectAll();

    //保存与角色的关系
    void insertEmployeeAndRoleRelation(@Param("employeeId") Long employeeId, @Param("roleId") Long roleId);

    //删除与角色的关系
    void deleteRelationByEmployeeId(Long id);

    //根据用户名查询员工
    Employee selectInfoByUsername(String username);

    //表单验证用户名是否已经存在
    String selectUsername(String username);

    //批量删除
    void batchDelete(Long[] ids);

    //移交时过滤当前用户的查询
    List<Employee> selectEmpsById(Long id);

}